<template>
  <div id="mainn" class="pie" />
</template>

<script>
import * as echarts from 'echarts'
export default {
  mounted() {
    const chartDom = document.getElementById('mainn')
    const myChart = echarts.init(chartDom)
    const option = {
      title: {
        text: '房产数量比例',
        subtext: 'Fake Data'
      },
      tooltip: {
        trigger: 'item'
      },
      legend: {
        top: '5%',
        left: 'center'
      },
      series: [
        {
          name: 'Access From',
          type: 'pie',
          radius: ['40%', '70%'],
          avoidLabelOverlap: false,
          label: {
            show: false,
            position: 'center'
          },
          emphasis: {
            label: {
              show: true,
              fontSize: '40',
              fontWeight: 'bold'
            }
          },
          labelLine: {
            show: false
          },
          data: [
            { value: 1048, name: 'Search Engine' },
            { value: 735, name: 'Direct' },
            { value: 580, name: 'Email' }
          ]
        }
      ]
    }

    option && myChart.setOption(option)
  }
}
</script>

<style scoped>
.pie{
    height: 550px;
}

</style>
